package cn.org.zx.common.aop;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class BeanFactory {
	private static ApplicationContext ctx = null;
	private static String aopPath = "aop-beans.xml";
	static{
		if(ctx == null){
			ctx = new ClassPathXmlApplicationContext(aopPath);
		}
	}
	public static Object getBean(Object blh){
		String className = blh.getClass().getName();
		return ctx.getBean(className);
	}
	
}
